package com.shujia.rec.controller;

import com.shujia.rec.service.LogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class LogController {


    @Autowired
    private LogService logService;

    @RequestMapping("/log")
    public String log(Integer id, Integer prod, Integer action, Long ts) {
        System.out.println(id + "\t" + prod + "\t" + action + "\t" + ts);
        String log = id + "," + prod + "," + action + "," + ts;
        logService.sendLog(log);
        return "ok";
    }
}
